<?php

	class Request implements iModel {
		
		public $requestId;
		public $service;
		public $roomGuestId;
		public $requestDate;
		public $employee;
		public $responseDate;
		public $requestItemList;
		public $userRequest;
		public $regionName;
		
		public function __construct() {
			$this->setService(new Service());
			$this->setEmployee(new Employee());
			$this->setRequestItemList(array());
		}
		
		public function getRequestId() {
			 return $this->requestId; 
		}
		 
		public function getService() {
			 return $this->service; 
		}
		 
		public function getRoomGuestId() {
			 return $this->roomGuestId; 
		} 
		
		public function getRequestDate() {
			 return $this->requestDate; 
		}
		 
		public function getEmployee() {
			 return $this->employee; 
		}
		 
		public function getResponseDate() {
			 return $this->responseDate; 
		}
		 
		public function getRequestItemList() {
			 return $this->requestItemList; 
		}
		
		public function getUserRquest() {
			 return $this->userRequest; 
		}
		 
		public function getRegionName() {
			 return $this->regionName; 
		} 
		 
		public function setRequestId($requestId) {
			 $this->requestId = $requestId; 
		}
		 
		public function setService($service) {
			 $this->service = $service; 
		}
		 
		public function setRoomGuestId($roomGuestId) {
			 $this->roomGuestId = $roomGuestId; 
		}
		 
		public function setRequestDate($requestDate) {
			 $this->requestDate = $requestDate; 
		}
		 
		public function setEmployee($employee) {
			 $this->employee = $employee; 
		}
		 
		public function setResponseDate($responseDate) {
			 $this->responseDate = $responseDate; 
		}
		 
		public function setRequestItemList($requestItemList) {
			 $this->requestItemList = $requestItemList; 
		}
		
		public function setUserRequest($userRequest) {
			 $this->userRequest = $userRequest; 
		}
		
		public function setRegionName($regionName) {
			$this->regionName = $regionName;
		}
		
		public function JSONToObject($requestJSON) {
			
			$this->setRequestId($requestJSON->requestId);
			$this->setRoomGuestId($requestJSON->roomGuestId);
			$this->setRequestDate($requestJSON->requestDate);
			
			$service = new Service();
			$service->JSONToObject($requestJSON->service);
			$this->setService($service);		
			
			$requestItemList = array();
			foreach ($requestJSON->requestItemList as $requestItemJSON) {
				$requestItem = new RequestItem();
				$requestItem->JSONToObject($requestItemJSON);
				array_push($requestItemList, $requestItem);
			}
			$this->setRequestItemList($requestItemList);
		}
		
	}

?>